package aiP.A3.FertigungKomponente.DataAccessLayer.Entity;

import aiP.A3.PersistenceService.iEntity;

import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.Id;

/**
 * Created with IntelliJ IDEA.
 * User: Hero
 * Date: 22.05.14
 * Time: 13:51
 * To change this template use File | Settings | File Templates.
 */
@javax.persistence.Table(name = "AI_BAUTEIL_STUECKLISTEN_POS", schema = "AIP", catalog = "")
//@javax.persistence.Table(name = "AI_BAUTEIL_STUECKLISTEN_POS", schema = "HR", catalog = "")
@Entity
public class BauteilStuecklistenPos implements iEntity {

    private int bauteilNr;

    @javax.persistence.Column(name = "BAUTEIL_NR")
    @Id
    public int getBauteilNr() {
        return bauteilNr;
    }

    public void setBauteilNr(int bauteilNr) {
        this.bauteilNr = bauteilNr;
    }

    private int stuecklisteNr;

    @javax.persistence.Column(name = "STUECKLISTE_NR")
    @Id
    public int getStuecklisteNr() {
        return stuecklisteNr;
    }

    public void setStuecklisteNr(int stuecklisteNr) {
        this.stuecklisteNr = stuecklisteNr;
    }


    private Integer menge;

    @javax.persistence.Column(name = "MENGE")
    @Basic
    public Integer getMenge() {
        return menge;
    }

    public void setMenge(Integer menge) {
        this.menge = menge;
    }

    private int position;

    @javax.persistence.Column(name = "POSITION")
    @Basic
    public int getPosition() {
        return bauteilNr;
    }

    public void setPosition(int position) {
        this.position = position;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        BauteilStuecklistenPos that = (BauteilStuecklistenPos) o;

        if (bauteilNr != that.bauteilNr) return false;
        if (position != that.position) return false;
        if (stuecklisteNr != that.stuecklisteNr) return false;
        if (menge != null ? !menge.equals(that.menge) : that.menge != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = bauteilNr;
        result = 31 * result + stuecklisteNr;
        result = 31 * result + (menge != null ? menge.hashCode() : 0);
        result = 31 * result + position;
        return result;
    }
}
